package ewgenius.testgame.main.objects;

import java.util.Random;

import org.lwjgl.util.vector.Vector2f;
import org.lwjgl.util.*;

import ewgenius.xube.XubeEngine;
import ewgenius.xube.engine.InputState;
import ewgenius.xube.engine.entities.Entity;
import ewgenius.xube.engine.graphics.Render;
import ewgenius.xube.engine.graphics.gui.*;

public class TestEntity extends Entity {
	
	public Vector2f position = new Vector2f();
	private Color color =  new Color(Color.WHITE);
	private int speed = 10;
	
	public TestEntity(String name, int id) {
		super(name, id);
		System.out.print("object \"" + name + "\" added");
	}

	public void update(int time, XubeEngine engine) {
		InputState input = engine.getInputState();
		
		position.x = input.mouseX;
		position.y = input.mouseY;
		
		//if(input.mouseButton[0])
			//engine.addEntity(new TestEntity1("ttttt", 0));
		/*
		if(input.keyUp)
			position.y += speed;
		if(input.keyDown)
			position.y -= speed;
		if(input.keyRight)
			position.x += speed;
		if(input.keyLeft)
			position.x -= speed;*/
	}

	public void render(Render render) {
		render.begin2DRender();
		
		render.draw2DRect(position, 10, 10, color);
		
		render.end2DRender();
	}
}